package com.fashion.service;

import java.util.List;

import com.fashion.model.News;
import com.fashion.model.NewsColumn;
import com.fashion.utils.ColumnTree;

/**
 * User: juventus
 * Date: 11-5-3
 * Time: 
 */
public interface ColumnService {
    /**
     * Find all columns and then put them in to a tree
     * */
    List<NewsColumn> findAllTreeColumns();

     /**
     * Find all single columns
     * */
    List<NewsColumn> findAllFlatColumns();

    void saveOrUpdateColumn(NewsColumn column);

    void deleteColumnById(String id);

    List<ColumnTree> convertToTrees(List<NewsColumn> newsColumns);
    
    @Deprecated
    NewsColumn findColumnByName(String name);
    
    NewsColumn findColumnByUrl(String topColumnUrl, String columnUrl);
    
    List<NewsColumn> getAllChildren(NewsColumn target);
    
    List<NewsColumn> findNewsColumnsByNews(News news);

    NewsColumn findTopColumn(NewsColumn column);

    List<NewsColumn> findAllFlatChildren(NewsColumn top);

    List<NewsColumn> findUrlForPathColumn(NewsColumn column);

    boolean isValidUrl(String topColumnUrl, String columnUrl);
    
    List<NewsColumn> findColumns(String[] ids);
}